[release/2.11] Bump torchvision pin to ROCm/vision rocJPEG backport (ROCm/vision#10)#3411
Merged
Merged
Conversation
Points the release/2.11 torchvision pin at ROCm/vision#10 (backport of pytorch/vision#9342, rocJPEG GPU JPEG decode).
|
Jenkins build for b1b5e613dca78e172c41f90d2c6f8c5ca96d9ffa commit finished as FAILURE Detected error during base docker image building: |
jithunnair-amd
pushed a commit
to ROCm/vision
that referenced
this pull request
Jul 16, 2026
…#9342) (#10) ## What this does Backports rocJPEG GPU JPEG decoding (upstream **pytorch#9342**) to `release/0.26`, so `decode_jpeg(..., device="cuda")` works on ROCm (MI300 / gfx94X) using rocJPEG's hardware backend for `UNCHANGED`, `GRAY`, and `RGB` modes. Gated by `TORCHVISION_USE_ROCJPEG` / `ROCJPEG_FOUND`, alongside the existing nvJPEG CUDA path. ## Why this is a manual backport (not a cherry-pick) `pytorch#9342` was merged against `main`, which has since diverged significantly from `release/0.26`. A `git cherry-pick` does not apply. The change had to be re-implemented against the `release/0.26` layout: - **Stable ABI vs classic API:** upstream uses the torch stable ABI (`torch::stable::Tensor`, `STABLE_TORCH_LIBRARY_IMPL`, `common_stable.*`, the separate `image_stable` extension). `release/0.26` has none of that, so the decoder was rewritten with the classic `torch::Tensor` / `at::empty` / `TORCH_CHECK` API. - **File placement / hipify:** upstream hand-writes `io/image/hip/decode_jpegs_cuda.cpp`. On `release/0.26` the ROCm build hipifies `io/image/cuda/*` into `hip/`, so the rocJPEG path lives in `cuda/decode_jpegs_cuda.{cpp,h}` guarded by `#if ROCJPEG_FOUND` and flows through hipify (verified: it transforms cleanly into `hip/decode_jpegs_hip.cpp` with the `decode_jpegs_cuda` symbol and all `rocJpeg*` calls intact). - **Op registration:** `release/0.26` registers via a single `.op("image::decode_jpegs_cuda", ...)` in `image.cpp`, so the upstream dual `#if !ROCJPEG_FOUND` registration split was not needed. - **setup.py:** added `USE_ROCJPEG` + `ROCJPEG_FOUND` detection to `make_image_extension` (no `STABLE_SOURCES` / `image_stable` plumbing, which don't exist here). ## Changes - `torchvision/csrc/io/image/cuda/decode_jpegs_cuda.h` - `RocJpegDecoder` class + `CHECK_ROCJPEG`/`CHECK_HIP` macros under `#if ROCJPEG_FOUND`. - `torchvision/csrc/io/image/cuda/decode_jpegs_cuda.cpp` - rocJPEG decode implementation (classic API); stub guard changed to `#if !NVJPEG_FOUND && !ROCJPEG_FOUND`. - `setup.py` - `TORCHVISION_USE_ROCJPEG` / `ROCJPEG_FOUND` detection and `rocjpeg` linkage. - `test/test_image.py` - `IS_ROCM` tolerance bump for decode; skip GPU JPEG *encoder* tests (rocJPEG is decode-only). - `torchvision/io/image.py` - docstring note about the rocJPEG path. ## Capability notes rocJPEG uses `ROCJPEG_BACKEND_HARDWARE`, which rejects images smaller than 64x64 and 4:1:1 / unknown chroma subsampling. ## Validation Built via TheRock "Multi-Arch Build Portable Linux PyTorch Wheels" against this pin: https://github.com/ROCm/TheRock/actions/runs/28960912700 - Build (torch + rocJPEG torchvision, gfx94X, py3.12): **success**. - PyTorch test suite: 39627 passed; the only 4 failures are unrelated (`test_unary_ufuncs.py` uint8 `threshold` OverflowError), not JPEG/torchvision. ## Companion PR Pin bump in ROCm/pytorch `release/2.11`: ROCm/pytorch#3411
Updates the release/2.11 torchvision pin to the merged ROCm/vision release/0.26 commit 3d50b2155c02d26e78b9c09baf99f5c707d70215 (ROCm/vision#10).
ethanwee1
marked this pull request as ready for review
July 16, 2026 17:21
|
Jenkins build for 7860bde06b74fda188068bcdb9c64286c14d7a1e commit finished as FAILURE Detected error during base docker image building: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Bumps the torchvision pin in
related_commitsforrelease/2.11so ROCm PyTorch picks up rocJPEG GPU JPEG decoding.torchvision | release/0.26:f37951448379bca5dfb29f6f345a80e721ea477c->8ced453e49d3cf57f8a713f13fc49bc0b513aa0d(ubuntu + centos lines). Repo/branch stayROCm/vision/release/0.26.The new commit is the backport of pytorch/vision#9342 (rocJPEG decode), adapted to the
release/0.26classic (non stable-ABI) layout.Companion PR
torchvision backport: ROCm/vision#10
Validation
Built via TheRock "Multi-Arch Build Portable Linux PyTorch Wheels" against this branch: https://github.com/ROCm/TheRock/actions/runs/28960912700
related_commits).test_unary_ufuncs.pyuint8thresholdOverflowError), not JPEG/torchvision.